<!DOCTYPE html>
<html>
<head>
    <title>API测试</title>
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</head>
<body>
    <h1>API连接测试</h1>
    <button onclick="testAPI()">测试API</button>
    <div id="result"></div>
    
    <script>
        async function testAPI() {
            const resultDiv = document.getElementById('result');
            resultDiv.innerHTML = '测试中...';
            
            try {
                console.log('开始测试API...');
                const response = await axios.get('http://localhost:8000/api/scan/results?status=not_seeding');
                console.log('API响应:', response);
                
                resultDiv.innerHTML = `
                    <h3>测试成功!</h3>
                    <p>状态码: ${response.status}</p>
                    <p>数据长度: ${response.data.length}</p>
                    <pre>${JSON.stringify(response.data, null, 2)}</pre>
                `;
            } catch (error) {
                console.error('API测试失败:', error);
                resultDiv.innerHTML = `
                    <h3>测试失败!</h3>
                    <p>错误: ${error.message}</p>
                    <p>详情: ${JSON.stringify(error, null, 2)}</p>
                `;
            }
        }
    </script>
</body>
</html>